package com.x.wx.service;

import java.util.List;

import com.alibaba.dubbo.config.annotation.Service;
import com.x.framework.exception.BusinessException;
import com.x.framework.exception.ExceptionCode;
import com.x.framework.service.BaseService;
import com.x.wx.dao.WxUserDao;
import com.x.wx.model.WxUser;
import com.x.wx.rpc.WxUserRpcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.stereotype.Component;


@Component
@Service(interfaceName = "com.x.wx.rpc.WxUserRpcService", timeout = 10000)
public class WxUserService extends BaseService implements WxUserRpcService{

	@Autowired
	private WxUserDao wxUserDao;//车辆配置关系DAO

	public WxUser insertWxUser(WxUser wxUser) {
		try {
			return this.insert(wxUser);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	public int updateWxUser(WxUser wxUser) {
		try {
			return this.update(wxUser);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	public int updateWxUser(WxUser wxUser, WxUser whereWxUser) {
		try {
			return this.update(wxUser,whereWxUser);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	public List<WxUser> selectWxUserList(WxUser wxUser) {
		try {
			return wxUserDao.selectWxUserList(wxUser);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	public int selectWxUserNum(WxUser wxUser) {
		try {
			return wxUserDao.selectWxUserNum(wxUser);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

}
